package com.fhz.shop.di;

import com.fhz.shop.api.ServiceApi;
import com.fhz.shop.util.RetrofitMananger;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import dagger.hilt.InstallIn;
import dagger.hilt.components.SingletonComponent;
import retrofit2.Retrofit;

/**
 * 时间:2023/8/17
 *
 * @author Mr.Feng
 * 简述: hilt
 */
@Module
@InstallIn(SingletonComponent.class)
public class HTTPModule {

    @Provides
    @Singleton
    public static ServiceApi getSerciceApi(Retrofit retrofit){
        return retrofit.create(ServiceApi.class);
    }

    @Provides
    @Singleton
    public static Retrofit getRrofit(){
        return RetrofitMananger.getInstance().getRetrofit();
    }


}
